<!doctype html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8" />
  <title>Kexio 模块1-应用启动模块 · 流程图</title>
  <meta name="viewport" content="width=device-width,initial-scale=1" />
  <style>
    :root { --bg:#f7f9fc; --fg:#0f172a; --muted:#64748b; --accent:#2563eb; --ok:#16a34a; --warn:#ea580c; --err:#dc2626; --box:#ffffff; --line:#cbd5e1; }
    body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial;background:var(--bg);color:var(--fg)}
    .wrap{max-width:1100px;margin:24px auto;padding:0 16px}
    h1{font-size:20px;margin:0 0 16px}
    .board{display:grid;grid-template-columns:repeat(2,minmax(300px,1fr));gap:16px;align-items:start}
    @media (max-width:1024px){.board{grid-template-columns:repeat(1,minmax(300px,1fr))}}
    .lane-title{font-size:13px;color:var(--muted);padding:0 4px 4px}
    .col{display:flex;flex-direction:column;gap:10px}
    .box{background:var(--box);border:1px solid var(--line);border-radius:8px;padding:10px 12px;box-shadow:0 1px 2px rgba(0,0,0,.04);font-size:13px}
    .box .hd{font-weight:600;margin-bottom:6px}
    .box .cls{color:var(--accent);font-weight:600}
    .box .tx{color:var(--muted);line-height:1.35}
    .ok{border-left:4px solid var(--ok)}.warn{border-left:4px solid var(--warn)}.err{border-left:4px solid var(--err)}
    .arrow-v{display:flex;align-items:center;justify-content:center;height:18px}
    .arrow-v::after{content:"↓";color:var(--muted);font-size:18px}
    code{background:#eef2ff;color:#1e293b;padding:1px 6px;border-radius:6px}
    .legend{margin-top:18px;display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
    .pill{padding:2px 8px;border-radius:999px;border:1px solid var(--line);background:#fff}
  </style>
</head>
<body>
<div class="wrap">
  <div class="nav"><a href="权限总览.html">总览</a> <a class="active" href="模块1-应用启动模块.html">模块1</a> <a href="模块2-通用工具模块.html">模块2</a> <a href="模块3-认证授权模块.html">模块3</a> <a href="模块4-用户管理模块.html">模块4</a></div>
  <h1>模块1 · 应用启动模块（配置装配与引导流程）</h1>
  <style>
    .nav{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px}
    .nav a{padding:4px 10px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--accent);text-decoration:none}
    .nav a.active{background:#eef2ff}
  </style>

  <div class="board">
    <div>
      <div class="lane-title">启动引导</div>
      <div class="col">
        <div class="box ok"><div class="hd">1) 入口</div><div class="tx"><span class="cls">com.kexio.KexioApplication</span><br/>- SpringApplication.run()</div></div>
        <div class="arrow-v"></div>
        <div class="box"><div class="hd">2) 配置装载</div><div class="tx">application.yml / application-*.yml</div></div>
        <div class="arrow-v"></div>
        <div class="box"><div class="hd">3) 自动装配</div><div class="tx"><span class="cls">com.kexio.auth.config.AuthAutoConfiguration</span><br/>- 安全/缓存/事件/租户 等条件化 Bean</div></div>
        <div class="arrow-v"></div>
        <div class="box"><div class="hd">4) 数据源与Flyway</div><div class="tx">DynamicDatasource + Flyway 迁移</div></div>
        <div class="arrow-v"></div>
        <div class="box ok"><div class="hd">5) 应用就绪</div><div class="tx">端口监听、日志输出</div></div>
      </div>
    </div>

    <div>
      <div class="lane-title">关键配置</div>
      <div class="col">
        <div class="box"><div class="hd">权限事件</div><div class="tx"><code>kexio.auth.events.enabled: true</code><br/><code>kexio.auth.events.publisher: redis</code><br/><code>kexio.auth.events.redis.stream: kexio:auth:events</code></div></div>
        <div class="box"><div class="hd">只读画像</div><div class="tx"><code>kexio.auth.redis-projection.enabled: true</code></div></div>
        <div class="box"><div class="hd">多级缓存</div><div class="tx"><code>kexio.auth.cache.l1/l2.*</code></div></div>
        <div class="box"><div class="hd">多租户</div><div class="tx"><code>kexio.auth.tenant.enabled</code></div></div>
        <div class="box"><div class="hd">Actuator/Prometheus</div><div class="tx"><code>management.endpoints.web.exposure.include: metrics,health,prometheus</code></div></div>
      </div>
    </div>
  </div>

  <div class="legend">
    <span class="pill">入口：<code>com.kexio.KexioApplication</code></span>
    <span class="pill">自动装配：<code>AuthAutoConfiguration</code></span>
    <span class="pill">事件：Redis Streams（publisher=redis）</span>
  </div>
</div>
</body>
</html>

